<?php
@session_start();
if(@$_SESSION['userid'] == '' ){
	$_SESSION['userurl']= 'http://' . $_SERVER ['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
	}

    include "../mysql/mysql.php";
    $aa = new mysql;
    $aa->link("");
    include "../myfunction.php";
    $bb= new myfunction;	
?>

<style type="text/css">
#head{background-color:#FFF; 
      height: 80px; 
      box-shadow:3px 3px 3px #999999;
	  _webkit-box-shadow:3px 3px 3px #999999;
	  _moz-box-shadow:3px 3px 3px #999999;
 }

#head td{padding-right: 29px;
         padding-top: 5px;
        }


a{text-decoration:none;}

#img1{width: 50px; height: 50px;}
#img2, #img3{width: 30px; height: 30px;}
</style>

<div id="head">
    <table style="width:1100px; margin: auto;" align="center">
        <tr>
            <td style="width:150px"><img src="../img/head-logo.jpg" id="img1"/></td> 
            <td><a href="../homepage.php">官方主页</a></td> <td><a href="shoppingmall.php">在线商城</a></td> 
            <td><a href="../product1.php"><?php echo @$product1; ?>smartisan T3</a></td> <td><a href="../product2.php">坚果 Pro2<?php echo @$product2; ?></a></td> 
            <td><a href="../smartisanOS.php">samrtisan OS</a></td> <td><a href="../download.php">应用下载</a></td>
            <td><a href="../bbs/bbs.php">官方论坛</a></td> <td>|</td>
            <td>
                <?php
                    if(@$_SESSION['userid'] == ''){ 
					 //var_dump(@$_SESSION['userid']);echo 1;
					?>
                <a href="user/login.php">登录</a>
                <?php }
				       else{ 
					       $userid = @$_SESSION['userid'];
						  // var_dump($_SESSION['userid']);echo 2;
					       $user = $bb->finduser($userid);
					   ?>
                       <a href="../user/userinfo.php?id=<?php echo $user['id']; ?>"><img src="../<?php if($user['img'] != ''){ echo $user['img'];}else{ echo 'user/img/mopic.jpg';} ?>" id="img3" /></a>
                       <?php } ?>
             
             
             </td> 
             <td><img src="../img/head-shoppingcar.jpg" id="img2"/></td>
        </tr>
    </table>
</div>